package com.wanmait.myhouse.managerController;

import com.wanmait.myhouse.dao.MediatorDAO;
import com.wanmait.myhouse.vo.Mediator;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("manager")
public class MediatorByNameController {

    @GetMapping("mediatorByName")
    public String mediatorByName(String mediatorName, Model model){
        MediatorDAO mediatorDAO = new MediatorDAO();
        Mediator mediator = mediatorDAO.mediatorByName(mediatorName);
        model.addAttribute("mediator",mediator);
        return "/manager/mediatorByname";
    }

}
